package com.smartleanx.module.hrm.service.esign.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.smartleanx.framework.datapermission.core.annotation.DataPermission;
import com.smartleanx.framework.tenant.core.aop.TenantIgnore;
import com.smartleanx.module.hrm.dal.mysql.esign.HrmECustomComponentsMapper;
import com.smartleanx.module.hrm.service.esign.service.HrmECustomComponentsService;
import com.smartleanx.module.hrm.service.esign.temp.po.HrmECustomComponents;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * e签宝自定义控件Service实现
 *
 * @author xzq
 * @since 2025-07-11 13:54:49
 */
@Service
public class HrmECustomComponentsServiceImpl extends ServiceImpl<HrmECustomComponentsMapper, HrmECustomComponents> implements HrmECustomComponentsService {


    @Override
    public List<HrmECustomComponents> getComponentsList() {
        return list(new LambdaQueryWrapper<HrmECustomComponents>()
        .eq(HrmECustomComponents::getDataStatus,1)
        .isNull(HrmECustomComponents::getComponentId));
    }

    @Override
    @DataPermission(enable = false) //是否开启权限
    @TenantIgnore
    public List<HrmECustomComponents> getComponentsFixedList() {
        return list(new LambdaQueryWrapper<HrmECustomComponents>()
                .eq(HrmECustomComponents::getDataStatus,1)
                .eq(HrmECustomComponents::getTenantId,999999));
    }

    @Override
    public List<HrmECustomComponents> getComponentsCustomList() {
        return list(new LambdaQueryWrapper<HrmECustomComponents>()
                .eq(HrmECustomComponents::getDataStatus,1));
    }
}
